<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>微信特殊服务配置类管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			
			
			var val  = '${businessConfig.beMember}';
			if(val != "1"  && val != 'true'){
				val ="0";
			} else{
				val ="1";
			}
			
			$("input[type='radio'][name='beMember'][value='"+val+"']").attr("checked", "checked");
			
			
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/wechat/businessConfig/">微信特殊服务配置类列表</a></li>
		<li class="active"><a href="${ctx}/wechat/businessConfig/form?id=${businessConfig.id}">微信特殊服务配置类<shiro:hasPermission name="wechat:businessConfig:edit">${not empty businessConfig.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:businessConfig:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<form:form id="inputForm" modelAttribute="businessConfig" action="${ctx}/wechat/businessConfig/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">服务名称:</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="100" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">关键词:</label>
			<div class="controls">
				<form:input path="keywords" htmlEscape="false" maxlength="200" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">Bean ID:</label>
			<div class="controls">
				<form:input path="beanId" htmlEscape="false" maxlength="200" class="required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">Class Name:</label>
			<div class="controls">
				<form:input path="className" htmlEscape="false" maxlength="200" class="required"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">URL:</label>
			<div class="controls">
				<form:input path="url" htmlEscape="false" maxlength="1000"  />	<span class="alert"> 必须以 http://开头,替换参数:%uid%为商家ID,%wid%为微信ID </span>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">是否必须会员:</label>
			<div class="controls">
				<input type="radio" name="beMember"  value="1"/>是 &nbsp;<input type="radio" name="beMember"  value="0"/>否
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">匹配规则:</label>
			<div class="controls">
				<form:select path="ruleType">
					<form:options items="${ruleMapList }" itemLabel="value" itemValue="key"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" cols="10" rows="5"/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="wechat:businessConfig:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
